<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('角色列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="role-form">
                <input type="hidden" th:value="${id}" id="rid">
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    // var detailFlag = [[${@permission.hasPermi('storage:ware:remove')}]];
    var prefix = ctx + "statis/Cg";
    var prefixa=ctx+"statis/view";

    $(function() {
        var options = {
            url: prefix + "/listdetail/"+$("#rid").val(),
            detailUrl: prefixa + "/details/{id}",

            modalName: "厂商",
            columns: [{
                checkbox: true
            },
                {
                    title: "序号",
                    formatter: function (value, row, index) {
                        return $.table.serialNumber(index);
                    }
                },    {    field: 'detailid',
                    title: "采购单号",
                    visible: false,
                },
                {
                    field: 'firmName',
                    title: '厂商名称',
                },
                {
                    field: 'poPurIndent',
                    title: '采购单编号',
                },
                {
                    field: 'cgCount',
                    title: '采购数量',

                },

                {
                    field: 'totalMoney',
                    title: '金额',
                    formatter: function (value, row, index) {
                        return '￥'+value;
                    }
                },
                {
                    field: 'purTime',
                    title: '采购时间',

                },
                {
                    title: '操作',
                    align: 'center',
                    formatter: function(value, row, index) {
                        if (row.poPurIndent!= 0) {
                            var action = [];
                            action.push('<a class="btn btn-success btn-sm" style="margin-right: 5px" onclick="$.operate.detail(\''+ row.poPurIndent+'\')">查看详情</a>');
                            return action.join('');
                        } else {
                            return "";
                        }
                    }
                }]
        };
        $.table.init(options);
    });


</script>
</body>
</html>